﻿using System;
using System.Collections.Generic;
using System.Runtime.Serialization;

namespace NewsSystem.ClientModels
{
    [DataContract(Name = "CommentModel")]
    public class CommentModel
    {
        public CommentModel()
        {
            this.Comments = new HashSet<CommentModel>();
        }

        [DataMember(Name = "id")]
        public int Id { get; set; }

        [DataMember(Name = "content")]
        public string Content { get; set; }

        [DataMember(Name = "creationDate")]
        public DateTime CreationDate { get; set; }

        [DataMember(Name = "authorId")]
        public string AuthorNickname { get; set; }

        [DataMember(Name = "comments")]
        public ICollection<CommentModel> Comments { get; set; }

        [DataMember(Name = "articleId")]
        public int ArticleId { get; set; }

        [DataMember(Name = "parentCommentId")]
        public int ParentCommentId { get; set; }
    }
}